// @ts-ignore

 
import { api } from '@/utils/api';

/** 获取巡检点位列表 POST /proInspectionPoint/list */
export async function proInspectionPointList(
  body: BIZAPI.ProInspectionPointQuery,
  options?: ArgumentsType<typeof api>[1]
): Promise<BIZAPI.IResultListProInspectionPointEntity>;

export async function proInspectionPointList(
  body: BIZAPI.ProInspectionPointQuery,
  options?: ArgumentsType<typeof api>[1] & { tupleResponse: true }
): Promise<TupleResponse<BIZAPI.IResultListProInspectionPointEntity>>;

export async function proInspectionPointList(
  body: BIZAPI.ProInspectionPointQuery,
  options?: ArgumentsType<typeof api>[1] & { tupleResponse: false }
): Promise<BIZAPI.IResultListProInspectionPointEntity>;

export async function proInspectionPointList(
  body: BIZAPI.ProInspectionPointQuery,
  options?: ArgumentsType<typeof api>[1]
) {
  if (
    (
      options as ArgumentsType<typeof api>[1] & {
        tupleResponse: boolean;
      }
    )?.tupleResponse === true
  ) {
    return api<BIZAPI.IResultListProInspectionPointEntity>(`/app/proInspectionPoint/list`, {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json'
      },
      data: body,
      ...(options || {}),
      tupleResponse: true
    });
  }

  return api<BIZAPI.IResultListProInspectionPointEntity>(`/app/proInspectionPoint/list`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json'
    },
    data: body,
    ...(options || {})
  });
}

/** 保存巡检点位顺序 POST /proInspectionPoint/saveSort */
export async function proInspectionPointSaveSort(
  body: number[],
  options?: ArgumentsType<typeof api>[1]
): Promise<BIZAPI.IResultVoid>;

export async function proInspectionPointSaveSort(
  body: number[],
  options?: ArgumentsType<typeof api>[1] & { tupleResponse: true }
): Promise<TupleResponse<BIZAPI.IResultVoid>>;

export async function proInspectionPointSaveSort(
  body: number[],
  options?: ArgumentsType<typeof api>[1] & { tupleResponse: false }
): Promise<BIZAPI.IResultVoid>;

export async function proInspectionPointSaveSort(
  body: number[],
  options?: ArgumentsType<typeof api>[1]
) {
  if (
    (
      options as ArgumentsType<typeof api>[1] & {
        tupleResponse: boolean;
      }
    )?.tupleResponse === true
  ) {
    return api<BIZAPI.IResultVoid>(`/app/proInspectionPoint/saveSort`, {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json'
      },
      data: body,
      ...(options || {}),
      tupleResponse: true
    });
  }

  return api<BIZAPI.IResultVoid>(`/app/proInspectionPoint/saveSort`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json'
    },
    data: body,
    ...(options || {})
  });
}

/** 更新巡检点位 POST /proInspectionPoint/update */
export async function proInspectionPointUpdate(
  body: BIZAPI.ProInspectionPointUpdateReq,
  options?: ArgumentsType<typeof api>[1]
): Promise<BIZAPI.IResultVoid>;

export async function proInspectionPointUpdate(
  body: BIZAPI.ProInspectionPointUpdateReq,
  options?: ArgumentsType<typeof api>[1] & { tupleResponse: true }
): Promise<TupleResponse<BIZAPI.IResultVoid>>;

export async function proInspectionPointUpdate(
  body: BIZAPI.ProInspectionPointUpdateReq,
  options?: ArgumentsType<typeof api>[1] & { tupleResponse: false }
): Promise<BIZAPI.IResultVoid>;

export async function proInspectionPointUpdate(
  body: BIZAPI.ProInspectionPointUpdateReq,
  options?: ArgumentsType<typeof api>[1]
) {
  if (
    (
      options as ArgumentsType<typeof api>[1] & {
        tupleResponse: boolean;
      }
    )?.tupleResponse === true
  ) {
    return api<BIZAPI.IResultVoid>(`/app/proInspectionPoint/update`, {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json'
      },
      data: body,
      ...(options || {}),
      tupleResponse: true
    });
  }

  return api<BIZAPI.IResultVoid>(`/app/proInspectionPoint/update`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json'
    },
    data: body,
    ...(options || {})
  });
}
